﻿<UserControl
    x:Class="CodeShow.CS.Shared.ItemsControlDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:CodeShow.CS.Shared"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    
    <!--BeginCutPaste-->
    <UserControl.Resources>
        <DataTemplate x:Name="myItemsTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="75" />
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock
                    Grid.Column="1"
                    FontSize="18" 
                    Text="{Binding Name}" 
                    Margin="25,10,0,0"
                    HorizontalAlignment="Left"/>
                <TextBlock
                    Grid.Column="3"
                    FontSize="18" 
                    Text="{Binding Alias}" 
                    Margin="25,10,0,0"/>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition 
                Height="768" /> 
        </Grid.RowDefinitions>
        <ScrollViewer>
            <ItemsControl 
                x:Name="roster" 
                ItemTemplate="{StaticResource myItemsTemplate}" />
        </ScrollViewer>
    </Grid>
    <!--EndCutPaste-->
</UserControl>
